#!/bin/bash
module_name=$1
if [ -z ${module_name} ];then
	echo "module_name is null"
	exit
fi

output_source_file=${module_name}_info_log.c
output_header_file=${module_name}_info_log.h

input_source_file=xxx_info_log.c
input_header_file=xxx_info_log.h


echo "module name: ${module_name}"

module_upcase=$(echo ${module_name} | tr 'a-z' 'A-Z')
module_lowcase=$(echo ${module_name} | tr 'A-Z' 'a-z')
module_uplowcase=$(echo ${module_lowcase}|sed 's/\b[a-z]/\u&/g')

echo "${module_upcase}"
echo "${module_lowcase}"
echo "${module_uplowcase}"


cat ${input_source_file} | sed -e 's/XXX/'${module_upcase}'/g' -e 's/xxx/'${module_lowcase}'/g' -e 's/Xxx/'${module_uplowcase}'/g' > ${output_source_file}
cat ${input_header_file} | sed -e 's/XXX/'${module_upcase}'/g' -e 's/xxx/'${module_lowcase}'/g' -e 's/Xxx/'${module_uplowcase}'/g' > ${output_header_file}
